#Boa:Dialog:Dialog1

import wx

def create(parent,app):
    return Dialog1(parent,app)

[wxID_DIALOG1, wxID_DIALOG1BUTTONSEND, wxID_DIALOG1STATICTEXT1, 
 wxID_DIALOG1TEXTCTRLMESSAGE, 
] = [wx.NewId() for _init_ctrls in range(4)]

class Dialog1(wx.Dialog):
    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Dialog.__init__(self, id=wxID_DIALOG1, name='', parent=prnt,
              pos=wx.Point(162, 360), size=wx.Size(705, 97),
              style=wx.DEFAULT_DIALOG_STYLE, title=u'Send message')
        self.SetClientSize(wx.Size(697, 70))
        self.Bind(wx.EVT_CLOSE, self.OnDialog1Close)

        self.textCtrlMessage = wx.TextCtrl(id=wxID_DIALOG1TEXTCTRLMESSAGE,
              name=u'textCtrlMessage', parent=self, pos=wx.Point(40, 8),
              size=wx.Size(648, 21), style=0, value=u'')

        self.staticText1 = wx.StaticText(id=wxID_DIALOG1STATICTEXT1,
              label=u'Msg', name='staticText1', parent=self, pos=wx.Point(11,
              11), size=wx.Size(19, 13), style=0)

        self.buttonSend = wx.Button(id=wxID_DIALOG1BUTTONSEND, label=u'Send',
              name=u'buttonSend', parent=self, pos=wx.Point(600, 40),
              size=wx.Size(88, 23), style=0)
        self.buttonSend.Bind(wx.EVT_BUTTON, self.OnButtonSendButton,
              id=wxID_DIALOG1BUTTONSEND)

    def __init__(self, parent,app):
        self._init_ctrls(parent)
        self.app = app
        self.player_name = ''
        self.msg = ''
        self.SetTitle( self.app.player_name + ': send message to '+self.player_name )
    def OnButtonSendButton(self, event):
        if( self.player_name != '' ):
            self.msg = self.textCtrlMessage.GetValue()
            self.app.server_proxy.add_message( self.player_name , self.msg )
            self.EndModal( 1 )

    def OnDialog1Close(self, event):
        self.EndModal( 0 )
